function toTeamPage(teamId) {
	var data = {
		"teamId": teamId
	}
	$("#content").load("toTeamPage", data);
}

function getPerennialPlayer(season, teamId, dom) {
	dom.parent().children("button.btn-info").removeClass("btn-info");
	dom.parent().children("button.btn").addClass("btn-light");
	dom.removeClass("btn-light");
	dom.addClass("btn-info");
	var data = {
		"teamId": teamId,
		"season": season
	}
	$("#perennialPlayer").load("listRSPerennialPlayer", data);
}

function listRSPerennialPlayer(season, teamId, dom) {
	dom.parent().children("button.btn-info").removeClass("btn-info");
	dom.parent().children("button.btn").addClass("btn-light");
	dom.removeClass("btn-light");
	dom.addClass("btn-info");
	var data = {
		"teamId": teamId,
		"season": season
	}
	$("#perennialPlayer").load("listRSPerennialPlayer", data);
}

function listPSPerennialPlayer(season, teamId, dom) {
	dom.parent().children("button.btn-info").removeClass("btn-info");
	dom.parent().children("button.btn").addClass("btn-light");
	dom.removeClass("btn-light");
	dom.addClass("btn-info");
	var data = {
		"teamId": teamId,
		"season": season
	}
	$("#perennialPlayer").load("listPSPerennialPlayer", data);
}

function getTeamRadarMap(teamId) {
	var data = {
		"teamId": teamId,
	}
	$.ajax({
		url: "/getTeamRadarMap",
		type: "POST",
		contentType: "application/json",
		data: JSON.stringify(data),
		success: function(response) {
			var myChart = echarts.init($("#teamRadarMap").get(0));
			var option = {
				title: {
					text: '球队场均数据'
				},
				tooltip: {},
				radar: {
					// shape: 'circle',
					name: {
						textStyle: {
							color: '#fff',
							backgroundColor: '#999',
							borderRadius: 3,
							padding: [5, 5]
						}
					},
					indicator: [{
							name: '场均得分',
							max: 300
						},
						{
							name: '场均助攻',
							max: 80
						},
						{
							name: '场均失误',
							max: 50
						},
						{
							name: '场均篮板',
							max: 120
						},
						{
							name: '投篮命中率',
							max: 1.0
						},
					]
				},
				series: [{
					name: '球队场均数据',
					type: 'radar',
					// areaStyle: {normal: {}},
					data: [{
						value: [response.score, response.assists, response.fault, response.rebound, response.shooting_percentage],
						name: '球队场均数据'
					}]
				}]
			};

			myChart.setOption(option, true);

		}
	});
}
